﻿/*
 * This software is the confidential and proprietary
 * information of NetBay
 * Such confidential information should not be disclosed
 * NetBay copyright(c) 2010
 */

#region using
using System;
using System.Collections.Generic;
using System.ServiceModel;
using NetBay.Core.BusinessEntities;
using System.Drawing;
using NetBay.Core.BusinessEntities.Enum;
using System.IO;


#endregion

namespace Rio.WCF.Services
{
    [ServiceContract]
    public interface IWCFService
    {
        [OperationContract]
        ReturnBoolean DeleteExtractFolder(Guid p_oGuid, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnDoubleValue GetExtractedFolders(Guid p_oGuid, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnBoolean ExtractFolder(Guid p_oGuid, long p_iFolderId, string p_sFolderName, Dictionary<string, string> p_dicFolderIndex, Dictionary<string, string> p_dicFilePathItem, MessageRequest p_oMessageRequest);
        
        [OperationContract]
        ReturnBoolean CreateTemporaryDirectory(string p_sGuid, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnBoolean ConvertDocumentAppend(string p_sGuid, string p_sFileName, long p_lUserId,  MessageRequest p_oMessageRequest, bool p_bImport = false);

        [OperationContract]
        ReturnString ConvertDocumentFinish(string p_sGuid, long p_lUserId, MessageRequest p_oMessageRequest, bool p_bUsePrintMode = false);

        [OperationContract]
        ReturnBoolean DeleteTemporaryDirectory(string p_sGuid, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnBoolean CreateRefreshFile(string p_sGuidToString);

        [OperationContract]
        void DeleteRefreshFile(string p_sGuidToString);

        [OperationContract]
        ReturnBoolean DeleteImportDocument(List<string> p_sDocumentName, long p_iUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnBoolean DeleteImportDirectories(List<string> p_sDirectoriesList, long p_iUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        void CleanCacheDirectory(MessageRequest p_oMessageRequest);

        [OperationContract]
        void GeneratePdfPages(string p_sFileName, long p_lUserId, bool p_bImport, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnDoubleValue GetDocumentByFullPath(string p_sFullPathFileNameToReturn, int p_iStartPage, int p_iEndPage, MessageRequest p_oMessageRequest, bool p_bImport , long p_lUserId , string p_sVersion);

        [OperationContract]
        ReturnDoubleValue GetFileByFullPath(string p_sFullPathFileNameToReturn, MessageRequest p_oMessageRequest, long p_lUserId);

        [OperationContract]
        List<ImageRio> GetImageFromFullPath(List<string> p_lstImageFullPath, List<string> p_lstOriginalImageFullPath, MessageRequest p_oMessageRequest);

        [OperationContract]
        List<ImageRio> GetImportThumbNailList(long p_iUserId, bool p_bOrderByDescending,MessageRequest p_oMessageRequest);

        [OperationContract]
        List<ImageRio> GetImportThumbNailListFromPath(long p_iUserId, string p_directoryPath, bool p_bOrderByDescending, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnLong GetImportCountTiffPages(string p_sTiffFileName, long p_iUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnLong GetImportCountPdfPages(string p_sTiffFileName, long p_iUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnLong GetPageCountFromPdfFullPath(string p_sPdfFileFullPath, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnDoubleValue GetImportDocumentByFileName(string p_sDocumentName, long p_iUserId, int p_iStartPage, int p_iEndPage, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnLong GetPageCountFromTiffFullPath(string p_sTiffFileFullPath, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnString GetPrintableVersionOfDocumentFullPath(List<string> p_lstDocumentFullPath, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnBoolean ImportFileExists(string p_sFileName, long p_iUserId, MessageRequest p_oMessageRequest);
        
        [OperationContract]
        List<Document> MoveImportDocument(List<Document> p_lstDocument, long p_iUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        List<Document> MoveOrCopyDocumentWithFullPath(List<Document> p_lstDocument, long p_lUserId, bool isMoveAction, MessageRequest p_oMessageRequest);

        [OperationContract]
        ImageRio PostDocumentWithSegment(byte[] p_oDocumentSegment, string p_sDocumentName, long p_iUserId, Guid p_oSegmentGuid, int p_iSegmentOrder, Boolean p_bLastSegment);

        [OperationContract]
        ImageRio PostDocumentWithSegmentNoThumbnail(byte[] p_oDocumentSegment, string p_sDocumentName, long p_iUserId, Guid p_oSegmentGuid, int p_iSegmentOrder, Boolean p_bLastSegment);
        
        [OperationContract]
        ImageRio PostDocumentWithSegmentAndDirectory(byte[] p_oDocumentSegment, string p_sDocumentName, long p_iUserId, Guid p_oSegmentGuid, int p_iSegmentOrder, Boolean p_bLastSegment,string p_sDirectory);

        [OperationContract]
        ImageRio PostDocumentWithSegmentAndDirectoryMove(byte[] p_oDocumentSegment, string p_sDocumentNameFullPath, string p_sStockPath, Guid p_oSegmentGuid, int p_iSegmentOrder, Boolean p_bLastSegment, Boolean p_bMustOverWrite);
        
        [OperationContract]
        ReturnByte RotateImage(byte[] p_oImage, RotateFlipType p_fAngle, string p_sExtension, MessageRequest p_oMessageRequest);
        
        [OperationContract]
        ReturnObject SaveImportRotatedImages(Dictionary<string, Dictionary<int, RotateFlipType>> p_lstImagesToRotateAndSave, long p_iUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnObject SaveRotatedImagesWithFullPath(Dictionary<string, Dictionary<int, RotateFlipType>> p_lstImagesToRotateAndSave, MessageRequest p_oMessageRequest, long p_lUserId = 0);

        [OperationContract]
        ReturnObject SaveRotatedImagesWithFullPathAndDirectory(Dictionary<string, Dictionary<int, RotateFlipType>> p_lstImagesToRotateAndSave, MessageRequest p_oMessageRequest, long p_lUserId = 0, string p_sDirectoryName = null);

        [OperationContract]
        ReturnObject SaveImportRotatedImagesWithDirectory(Dictionary<string, Dictionary<int, RotateFlipType>> p_lstImagesToRotateAndSave, long p_lUserId, string p_sDirectoryName, MessageRequest p_oMessageRequest);

        [OperationContract]
        void PostDocument(byte[] p_oDocument, string p_sDocumentName, long p_iUserId);
        
        [OperationContract]
        ReturnBoolean RefreshFileExists(string p_sGuidToString, MessageRequest p_oMessageRequest);

        [OperationContract]
        List<OcrMaskItem> ProcessOcr(string p_sFileName, List<OcrMaskItem> p_lstOcrMaskItem, long p_lUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        string ProcessOcrArea(string p_sFileName, OcrArea p_oOcrArea, long p_lUserId, OcrType p_oOcrType, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnString CarveImportFiles(List<string> p_lstDocumentName, string p_sDirectoryName, long p_lUserId, int p_iNbPart, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnBoolean DeleteImportImages(List<ImageRio> p_lstDocumentName, long p_iUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnBoolean ImportDirectoryIsEmpty(string p_sDirectoryName, long p_iUserId, MessageRequest p_oMessageRequest);

        [OperationContract]
        void GenerateReport(long p_lUserId, string p_sXmlSourceDocumentName, string p_sReportDestinationFullPath, string p_sUserEmailAdress, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnLong SearchTextInImportDocument(string p_sFileName, long p_iUserId, string p_sSearchedWords, int p_lStartPage, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnLong SearchTextInDocument(string p_sFileNameFullPath, string p_sSearchedWords, int p_lStartPage, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnBoolean Duplicate_Document(string p_sDocumentNameFullPathSource, string p_sDocumentNameFullPathDestination, string p_sStockPath);

        [OperationContract]
        List<ImageRio> DoBarcodeRecognition(List<string> images, long p_lUserId, bool p_bOrderByDescending, MessageRequest p_oMessageRequest);

        [OperationContract]
        ReturnString ExplodePdf(string p_sFileSource, long p_lUserId, MessageRequest p_oMessageRequest);
    }
}
